# Contributor: Jens Pranaitis <jens@chaox.net>
# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>

pkgname=foremost
pkgver=1.5.6
pkgrel=1
pkgdesc="A console program to recover files based on their headers, footers, and internal data structures."
arch=('i686' 'x86_64')
url="http://foremost.sourceforge.net/"
license=('custom')
backup=(etc/foremost.conf)
source=(http://foremost.sourceforge.net/pkg/foremost-1.5.6.tar.gz \
        http://kambing.ui.edu/gentoo-portage/app-forensics/$pkgname/files/$pkgname-1.4-config-location.patch \
       $pkgname-makefile.diff)

md5sums=('1ac068f5681bbee679f99d2f9fa7f39f'
         '2666ad901eab09061c265b706494e140'
         '0e6b7f653b6b7811158ba7732dead04e')

build() {
  cd "${srcdir}/$pkgname-$pkgver"
  install -d "${pkgdir}"/{etc,{usr/bin,usr/share/man/man8}}

  make || return 1
  patch -Np0 -i "${srcdir}/$pkgname-makefile.diff" || return 1
  patch -Np1 -i "${srcdir}/$pkgname-1.4-config-location.patch" || return 1
  make DESTDIR="${pkgdir}" install || return 1

#license
  ./foremost -V > COPYRIGHT
  install -D -m644 "COPYRIGHT" "${pkgdir}/usr/share/licenses/$pkgname/COPYRIGHT" || return 1
}
